class Solution:
    def getSmallestString(self, s: str, k: int) -> str:

        def t(a):
            return ord(a) - ord("a")

        def f(a):
            return chr(a + ord("a"))

        def dis(a, b):
            return min(abs(a - b), abs(a + 26 - b))

        ans = []
        for c in s:
            for i in range(26):
                d = dis(i, t(c))
                if d <= k:
                    k -= d
                    ans.append(f(i))
                    break

        return "".join(ans)


s = Solution()
print(s.getSmallestString("zbbz", 3))
